package com.bobamrz.dao;

import java.util.List;

import javax.ws.rs.core.Response.StatusType;

import org.hibernate.Query;
import org.hibernate.Session;

import com.bobamrz.domain.DocStatusType;
import com.bobamrz.domain.Document;
import com.bobamrz.hibernate.HibernateUtil;

public class DocStatusTypeDAO {
	private Session session = HibernateUtil.getSessionFactory().getCurrentSession();
	
	public List<DocStatusType> getStatusTypesList() {
		String hql = "FROM DocStatusType";
		Query query = session.createQuery(hql);
		return query.list();
	}
	
	public DocStatusType getDocStatusTypeById(long id) {
		String hql = "FROM DocStatusType WHERE id=" + id;
		Query query = session.createQuery(hql);
		return (DocStatusType) query.list().get(0);
	}
}